export function getp_id() {
    const menuid = JSON.parse(localStorage.getItem("role_menu")).map(v => {
        let arr = v.path;
        let getVal = arr => arr.substring(arr.lastIndexOf("/") + 1, arr.length);
        return getVal(arr);
      });
      const allmenuid = JSON.parse(localStorage.getItem("role_menu")).map(v => {
        return v;
      });
      const menuids = JSON.parse(localStorage.getItem("role_menu")).map(v => {
        let arr = v.children;
        return arr;
      });
      let childrenpath = [];
      let childrenall = [];
      for (let i = 0; i < menuids.length; i++) {
        for (let j = 0; j < menuids[i].length; j++) {
          childrenpath.push(
            menuids[i][j].path.substring(
              menuids[i][j].path.lastIndexOf("/") + 1,
              menuids[i][j].path.length
            )
          );
          childrenall.push(menuids[i][j]);
        }
      }
      let allarr = menuid.concat(childrenpath);
      let allarray = allmenuid.concat(childrenall);
      for (let s = 0; s < allarray.length; s++) {
        if (
          localStorage.getItem("path") ==
          allarray[s].path.substring(
            allarray[s].path.lastIndexOf("/") + 1,
            allarray[s].path.length
          )
        ) {
            return allarray[s].id
          // this.p_id = allarray[s].id;
        }
      }
  }
